<template>
  <section>
   <section id="case-search-page">
      <w-row class="top">
        <w-cell direction="column" align="center">
            <img src='../../assets/img/search/banner.png'/>
            <span>醉强大脑</span>
        </w-cell>
      </w-row>
      <w-row class="center">
        <w-cell>
          <article class="wrap-box wui-border-tb case-search-msg">
            <w-field name="Title" v-model="Title" class="input-amount wui-border-radius-1px padspace" icon-align="right" :show-icon="true"  height="40" :showLabel="false" placeholder="搜索您想要的">
                <w-button slot="icon" :block="true" type="primary" :sharp="true" height="auto" @click="searchCase()"></w-button>
            </w-field>
          </article>
        </w-cell>
      </w-row>
      <!--<w-row class="bottom">
        <w-cell align="center">
           <w-button bg-color="#f2f2f2" font-color="#a8a8a8" border-color="#dbd9d9" width="3.625rem" height="1.575rem" @click="setType(0)">恒瑞</w-button>
        </w-cell>
         <w-cell align="center">
           <w-button bg-color="#f2f2f2" font-color="#a8a8a8" border-color="#dbd9d9" width="3.625rem" height="1.575rem" @click="setType(1)">诺扬</w-button>
        </w-cell>
         <w-cell align="center">
           <w-button bg-color="#f2f2f2" font-color="#a8a8a8" border-color="#dbd9d9" width="3.625rem" height="1.575rem" @click="setType(2)">艾贝宁</w-button>
        </w-cell>
      </w-row>-->
   </section>
   <section class="case-menu">
     <case-menu :tag="3"></case-menu>
   </section>
  </section>
</template>
<script>
  import caseMenu from '../../components/caseMenu';
  import { mapGetters, mapActions } from 'vuex';
  export default {
     name: 'caseSearch',
     data() {
       return {
         caseType: 0 ,
         Title: ''
       }
     },
     props: {

     },
    components: {
      caseMenu
    },
    methods: {
      ...mapActions([
         'addExLog'
      ]),
      searchCase: function() {
          //每日检索获得积分 +2
          let expar = {
                openID: localStorage.openID,
                Type: 4
          }
          this.addExLog(expar).then((res) => {
              localStorage.removeItem("userMsg");
              var _user = JSON.stringify(res.userInfo)
              localStorage.setItem('userMsg',_user);
          });
          this.$router.push({name:'case',params: {title: this.Title}});
      },
      setType: function(tid) {
        this.caseType = tid;
      }
    }
  }
</script>

<style lang="scss" scoped>
  #case-search-page {
        display: flex;
        flex-direction: column;
        align-items: center;
        height: 360px;
        justify-content: space-around;
        align-items: center;
        padding-top: 2rem;
        font-size: 0.6rem;
      .top {
          img {
              width: 5.55rem;
          }
          span {
              margin-top: 0.5rem;
              font-size: 1.5rem;
          }
      }
      .case-search-msg {
              width: 80%;
              margin: 0 auto;
              border: 1px solid #e1e1e1;
              border-radius: 8px;
              margin-bottom: -0.6rem;
              background: #f2f2f2;
              padding: 0 0 0 1rem;
              button {
                  width: 2.025rem;
                  height: 1.875rem !important;
                  background: url('../../assets/img/search/search.png') center no-repeat;
                  background-size: 100% auto;
              }
      }
      .wui-field {
           background: none !important;
       }
       .wui-border-1px {
           position: static !important;
       }
       .wui-button:after {
        height: 0 !important;
        width: 0 !important;
       }
      .wui-border-1px:after {
          border: 0 !important;
       }
  }
</style>
 